﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SteveTPham.QueryAnything.Utilities
{
	public static class FormUtil
	{
		public static void Busy(Control c, bool isBusy)
		{
			c.Enabled = !isBusy;
			c.Cursor = isBusy ? Cursors.WaitCursor : Cursors.Default;
		}

		public static void WinException(Exception exception)
		{
			WinException(exception, "Exception");
		}
		public static void WinException(Exception exception, string title)
		{
			MessageBox.Show(exception.Message, title);
		}

		public static bool Confirm(string message)
		{
			return MessageBox.Show(message, "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes;
		}
	}
}
